<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>这是登录页面</title>
</head>
<body>
<form action="user/login" id="user_login_form">
	账号<input name="username" value="admin">
	密码<input name="password" type="password" value="123456">
	<input type="submit" id="user_login">
</form>
</body>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
<script type="text/javascript">
	$(function() {
		$("#user_login").click(function() {
			$.ajax({
				type : "POST",
				url : "user/login",
				data : $("#user_login_form").serialize(),
				dataType : "json",
				success : function(re) {
					if (re) {
						window.location = "/home.html";
					}
					else {
						alert("登录失败,用户名应该是admin或者wendal,密码是123456");
					}
				}
			});
			return false;
		});
	});
</script>
</html>